<?php /* Smarty version Smarty-3.1.18, created on 2017-05-24 15:06:12
         compiled from "/data/www/mystery/protected/modules/webadmin/views/question/add.tpl" */ ?>
<?php /*%%SmartyHeaderCode:193082353954cf536657b231-63640967%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '705f1d3be818e92324e597efed55bd4b9198af2d' => 
    array (
      0 => '/data/www/mystery/protected/modules/webadmin/views/question/add.tpl',
      1 => 1494904924,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '193082353954cf536657b231-63640967',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.18',
  'unifunc' => 'content_54cf53665d5bc8_36647000',
  'variables' => 
  array (
    'info' => 0,
    'project' => 0,
    'val' => 0,
    'question_id' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_54cf53665d5bc8_36647000')) {function content_54cf53665d5bc8_36647000($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ("../common/header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

<table width="100%" border="0" cellspacing="0">
 <tr>
    <td width="13%" valign="top">
        <?php echo $_smarty_tpl->getSubTemplate ("../common/left.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

    </td>
    <td width="87%" valign="top">

    <table width="100%" border="0" cellspacing="0">
      <tr>
            <td>
                 <div class="subnav">
                   <div class="content-menu ib-a blue line-x"> 
                     <a href="/webadmin/question/list"><em>问卷管理</em></a><span>|</span>
                       <a href="javascript:void(0);" class="on"><em><?php if ($_smarty_tpl->tpl_vars['info']->value) {?>编辑问卷<?php } else { ?>添加问卷<?php }?></em></a>
                   </div>
                 </div>
                 <div class="pad_10">
                   <div class="table-list">
                        <div class="common-form">
                            <form name="myform" enctype="multipart/form-data" action="<?php if ($_smarty_tpl->tpl_vars['info']->value) {?>/webadmin/question/doedit<?php } else { ?>/webadmin/question/doadd<?php }?>" method="post" id="myform">
                           <table width="100%" class="table_form contentWrap">
                              <tbody>
                                      <tr>
                                              <td width="80">问卷编号</td> 
                                              <td><input type="text" name="identifier"  value="<?php echo $_smarty_tpl->tpl_vars['info']->value['identifier'];?>
" class="input-text" id="identifier"></td>
                                      </tr>
                                      <tr>
                                              <td width="80">问卷名称</td> 
                                              <td><input type="text" name="question_name" value="<?php echo $_smarty_tpl->tpl_vars['info']->value['question_name'];?>
" class="input-text" id="question_name"></td>
                                      </tr>
                                      <tr>
                                              <td width="80">是否显示得分</td> 
                                              <td><input type="radio" name="show_score" <?php if ($_smarty_tpl->tpl_vars['info']->value&&$_smarty_tpl->tpl_vars['info']->value['show_score']==1) {?>checked="checked"<?php }?> <?php if (!$_smarty_tpl->tpl_vars['info']->value) {?>checked="checked"<?php }?> value="1" />是<input type="radio" name="show_score" value="0" <?php if ($_smarty_tpl->tpl_vars['info']->value&&$_smarty_tpl->tpl_vars['info']->value['show_score']==0) {?>checked="checked"<?php }?> />否</td>
                                      </tr>
                                      <tr>
                                              <td width="80">所属项目</td> 
                                              <td>
                                                      <select name="project_id" autocomplete="off">
                                                              <option value="0">-请选择-</option>
                                                              <?php  $_smarty_tpl->tpl_vars['val'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['val']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['project']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['val']->key => $_smarty_tpl->tpl_vars['val']->value) {
$_smarty_tpl->tpl_vars['val']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['val']->key;
?>
                                                              <option <?php if ($_smarty_tpl->tpl_vars['info']->value['project_id']==$_smarty_tpl->tpl_vars['val']->value['project_id']) {?>selected="selected"<?php }?> value="<?php echo $_smarty_tpl->tpl_vars['val']->value['project_id'];?>
"><?php echo $_smarty_tpl->tpl_vars['val']->value['project_name'];?>
</option>
                                                              <?php } ?>
                                                      </select>
                                              </td>
                                      </tr>
                                      <tr>
                                          <td>上传客户网点</td>
                                          <td>
                                              <p>
                                                <span>
                                                    <input type="text" class="viewfile" id="viewfile" name="viewfile">
                                                </span>
                                                <label class="bottom" for="upload">查找文件</label><input type="file" class="file" onchange="document.getElementById('viewfile').value=this.value;" name="upfile" size="27">
                                                <a href="/webadmin/network/templateDown" class="button">网点导入模板下载</a>
                                            </p>
                                          </td>
                                      </tr>
                              </tbody>
                           </table>

                        <div class="bk15"></div>
                        <input name="question_id" type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['question_id']->value;?>
"/>
                        <input name="dosubmit" type="submit" value="提交" class="button">
                        </form>
                        </div>
                   </div>
                 </div>
            </td>
      </tr>
    </table>
</td>
 </tr>
</table>
											
<script type="text/javascript">
	$(document).ready(function(){
		$('form[name="myform"]').submit(function(){
			var selectVal = $('select[name="project_id"]').val();
                        var identifier = $('#identifier').val();
                        var question_name = $('#question_name').val();
                        if (identifier == '') {
                            alert('问卷编号不能为空');
                            return false;
                        }
                        if (question_name == ''){
                            alert('问卷名称不能为空');
                            return false;
                        } 
			if(!parseInt(selectVal)){
				alert("请选择问卷所属项目");
				return false;
			}
			return true;
		});
	});
</script>
<?php echo $_smarty_tpl->getSubTemplate ("../common/footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
<?php }} ?>
